package com.liy.framework.common.orm.dialect;

import org.apache.ibatis.session.Configuration;

public class DialectFactory {
    public static String dialectClass = null;

    public static Dialect buildDialect(Configuration configuration) {
        if (dialectClass == null) {
            Class var1 = DialectFactory.class;
            synchronized(DialectFactory.class) {
                if (dialectClass == null) {
                    dialectClass = configuration.getVariables().getProperty("dialectClass");
                }
            }
        }

        Dialect dialect = null;

        try {
            dialect = (Dialect)Class.forName(dialectClass).newInstance();
        } catch (Exception var3) {
            var3.printStackTrace();
            System.err.println("请检查 mybatis-config.xml 中  dialectClass 是否配置正确?");
        }

        return dialect;
    }
}
